<template>
	<!-- 全局搜索框 -->
	<u-search :placeholder="placeholder" v-model="modelValue"
	 search-icon="search"
	 search-icon-color="#B3B3B3"  :show-action="false" 
	 placeholder-color="#B3B3B3"  :bg-color="currentThemeObj.backgroundSecondColor" 
	 :clearabled="false" 
	 @change="getconfirm" 
	 height="88"
	 :adjust-position="false"/>
</template>

<script>
	export default {
		name:"itemSearch",
		props: {
			placeholder: {
				type: String,
				default: '请搜索'
			},
			value:{
				type:String,
				default:''
			}
		},
		data() {
			return {
				timer:null,
				modelValue:''
			};
		},
		methods: {
			getconfirm(){
				if(this.timer){
					clearTimeout(this.timer);
					this.timer = null;
				}
				this.timer = setTimeout(()=>{
					this.$emit('input',this.modelValue);
					this.$emit('change')
				},300)
			},
		},
	}
</script>

<style lang="scss">
.u-search{
	/deep/.u-content{
		padding: 0 40rpx;
	}
}
</style>
